﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace NKD07
{
    public partial class detail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // load all details of specific product
            LoadDetailProduct();
        }

        private void LoadDetailProduct()
        {
            try
            {
                int productID = int.Parse(Request.QueryString["productID"]);
                Classes.product product = new Classes.product();
                DataTable table =  product.GetProductByID(productID);
                if (table == null || table.Rows.Count == 0)
                {
                    Response.Redirect("default.aspx");
                }
                dtwProductDetails.DataSource = table;
                dtwProductDetails.DataBind();
            }
            catch (Exception)
            {
                Response.Redirect("default.aspx");
                String.Format("{0}",Eval("id"));
            }
        }
    }
}